<%@page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>
<%@include file="/includes/taglibs.jsp"%> 
<%@page import="com.feib.stms.action.BaseDoUploadFileActionbean"%>


<%
// 欄位排序處理
BaseDoUploadFileActionbean actionBean = (BaseDoUploadFileActionbean) request.getAttribute("actionBean");
pageContext.setAttribute("actionBeanClassName", actionBean.getClass().getName());
%>



<html>
<head>
<title></title>
<script type="text/javascript" src="<c:url value='/scripts/JSUtil.js'/>"></script>
	

<OBJECT classid="clsid:EDA76653-FDDE-4C1E-B65E-2AA3438A8A30"
    		codebase="<c:url value='/object/PKCS7SignatureClientCOM.cab#Version=4,12,3,1'/>" id =P7SignatureClientObj>
</OBJECT>

<OBJECT classid="clsid:C9B6115C-DEA9-11D6-8C3C-0050BAA6346E"
    		codebase="<c:url value='/object/CertificateDBClientCOM.cab#Version=4,12,29,1'/>" id =CertDBClientObj>
</OBJECT>

<script language="JavaScript"> 
	
//簽章 
function Sign(frm) {	
   	 if (getSigned(frm, P7SignatureClientObj, CertDBClientObj)){   	
   	  $("#hidden\\.doConfirmBtn").trigger('click');     	        
     }		
}

//驗章 
function Verify(frm) {	
	  //驗證簽章值錯誤
	 $("#hidden\\.doVerifyBtn").trigger('click');    	
}

</script>
</head>

<body>


<div id="smallQueryForm"></div>
	
<div id="queryForm"></div>
		
	<stripes:form name="confirmHiddenFrom" id="confirmHiddenFrom" beanclass="<%=actionBean.getClass().getName() %>" method="post" >
	
<div id="listForm">
		<table>
		
		<tr> 
				<td colspan="5" class="queryHeader">放行認證</td>
		</tr>
	    <c:forEach items="${actionBean.checkUploadFiles}" var="viewObj" varStatus="rowstat">
						<input name="checkUploadFiles[${rowstat.index}].uploadFilePk" 
							type="hidden" 
							id="checkUploadFiles[${rowstat.index}].uploadFilePk" 
							value="<c:out value='${viewObj.uploadFilePk}'/>" />																
		</c:forEach>
		<stripes:hidden id="hidden.fileConfirmRule.confirmType" name="fileConfirmRule.confirmType"/>

		<!--簽章所需參數-->
		<!--將放行檔案算出MD5值(c4abb809d2205c4096402c25a8f5ccec)，放入至簽章資料Data中-->
		<!--多個檔案一起放行(c4abb809d2205c4096402c25a8f5ccec,
                     3e9b94423e5cb2c0dfc9bad86c10572e)，放入至簽章資料Data中-->       
            <tr>
				<th>檔案MD5值：</th>				
				<td colspan="4"><stripes:text id="md5Data" name="md5Data" /></td>								
			</tr> 
			
			<stripes:hidden id="hidden.signerCert" name="signerCert"/>

			<!--驗章所需參數-->
			<stripes:hidden id="hidden.CNReturn" name="CNReturn"/>
			<!--登入帳號所持有的憑證序號CN(86517096-00-0044)，放入至serverCN中-->					
			 <tr>
				<th>憑證CN值：</th>				
				<td colspan="4"><stripes:text id="serverCN" name="serverCN" /></td>								
			</tr> 		
					
					<stripes:hidden id="hidden.clientCN" name="clientCN"/>
					<stripes:hidden id="hidden.signedvalue" name="signedvalue"/>
	
				<tr>
					<td colspan="15" class="listFunction">
						<input type="button" value="簽章" onclick="Sign(document.confirmHiddenFrom)" />
						<input type="button" value="驗章" onclick="Verify(document.confirmHiddenFrom)" />
					</td>	
				</tr>
			

		</table>
		<div style="display: none;">
					<stripes:submit id="hidden.doConfirmBtn" name="doConfirm" value="放行" class="formBtn"/>
					<stripes:submit id="hidden.doVerifyBtn" name="doVerify" value="放行認證" class="formBtn"/>					
	 </div>		
	</div>
</stripes:form>




</body>
</html>
		